# Replication Package: Why Feldstein-Horioka Correlations Vary — Demographics and the Savings Retention Puzzle

## Overview
This folder contains all files needed to replicate the analysis in "Why Feldstein-Horioka Correlations Vary: Demographics and the Savings Retention Puzzle." The paper shows that demographics do not predict capital account liberalization changes (Z₁ on ΔKAOPEN p=0.122) but strongly predict levels (Z₁=7.15***), then demonstrates that the pooled FH savings retention coefficient (0.054) masks demographic heterogeneity: S×Z₁=2.32*** (p<0.001), strengthening at 5yr (3.30***) and 10yr (3.50***) averages.

## Requirements
- Python 3.10+
- pandas, numpy, scipy, statsmodels
- Data files in data/processed/

## Structure
- `scripts/` — Analysis scripts (run in phase order)
- `src/` — Shared modules (PanelGLS estimator, data loading, country classifications)
- `data/processed/` — Processed panel data (extensions_panel.csv)
- `output/tables/` — Generated output tables
- `paper/` — Paper manuscript and references

## Reproduction
Run scripts in numerical phase order:
```
python scripts/phase1_data_prep.py
python scripts/phase4_kaopen_prediction.py
python scripts/phase5_reviewer_fixes.py
```

Phase 4 produces the KAOPEN prediction and Feldstein-Horioka baseline tables (kaopen_prediction.md). Phase 5 produces robustness tables (long-difference horizons, income group splits).

## Output Tables
- `kaopen_prediction.md` — KAOPEN prediction + FH baseline with S×Z interactions (Tables 1–2)
- `phase5_fh_long_diff.md` — FH long-difference robustness: annual, 5yr, 10yr averages (Table 3)
- `phase5_fh_income_robustness.md` — FH income group robustness: low/mid/high tercile splits (Table 4)

## Data Sources
- UN World Population Prospects 2024
- IMF World Economic Outlook
- Penn World Table 10.01
- Chinn-Ito KAOPEN Index
- World Bank WDI (national savings, gross investment, GDP)

## Notes
- All analysis uses the expanded panel (up to 170 countries, 1990–2024)
- The `src/` modules are from the multilateral/followup project
- Phases 2–3 (CA decomposition, twin deficits) belong to the companion paper ("The Demographic Erosion of Fiscal Leverage")
- The Granger-style horizon analysis (Table A1 in paper) is produced within phase 4
